<!--#include file="../../../core/common/Conn.asp" -->
<!--#include file="../../../core/common/Limit.asp" -->
<!--#include file="../../../core/common/Page.asp" -->
<!--#include file="../../../core/common/Function.asp" -->
<%
	dim action
	action = request.QueryString("action")
	if action = "del" then
		call del
	end if
	
	dim SUBJECTID,ID
	SUBJECTID = request.QueryString("subjectid")
	
	'删除新闻
	sub del
		SUBJECTID = request.QueryString("subjectid")
		ID = request.QueryString("id")
		
		db.execute("delete from NEWS where ID = " & ID)

		response.Redirect("index.asp?subjectid=" & SUBJECTID)
	end sub
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMSLite for ASP</title>
<link href="../../resource/css/reset.css" rel="stylesheet" type="text/css" />
<link href="../../resource/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../resource/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../../resource/js/common.js"></script>
</head>

<body>
	<div class="bottom_bar">
	<input type="button" class="button" value="新增" onclick="location.href='add.asp?subjectid=<%=SUBJECTID%>';" />
	<input type="button" class="button" value="返回" onclick="location.href='/admin/subject/subject.asp';" />
	</div>
	<table border="0" cellspacing="0" cellpadding="0" class="table_style_1">
	<thead>
		<tr>
			<th>标题 - <%=Get_Subject_Name(SUBJECTID)%></th>
			<th width="84">日期</th>
			<th width="84">作者</th>
			<th width="84">修改</th>
			<th width="84">删除</th>
		</tr>
	</thead>
	<tbody>
	<%
		dim page
		set page = new C_Page
		
		dim sql,rs,i
		sql = "select * from [NEWS] where SUBJECTID = '"& SUBJECTID &"' order by ID desc"
		set rs = db.query(sql)
		if not rs.eof then
			i = 1
			page.page_size = 12
			page.setRS(rs)
			do while not rs.eof and i <= page.page_size
	%>
		<tr>
			<td class="main"><a href="edit.asp?subjectid=<%=SUBJECTID%>&id=<%=rs("ID")%>"><%=rs("TITLE")%></a></td>
			<td><%=year(rs("UPDATETIME"))%>-<%=month(rs("UPDATETIME"))%>-<%=day(rs("UPDATETIME"))%></td>
			<td><%=rs("AUTHOR")%></td>
			<td><a href="edit.asp?subjectid=<%=SUBJECTID%>&id=<%=rs("ID")%>">修改</a></td>
			<td><a href="?action=del&subjectid=<%=SUBJECTID%>&id=<%=rs("ID")%>">删除</a></td>
		</tr>
	<%
				rs.movenext
				i = i + 1
			loop
	%>
		<tr>
			<td class="page" colspan="5"><% page.page_list() %></td>
		</tr>
	<%
		else
	%>
		<tr>
			<td class="page" colspan="5">找不到任何内容！</td>
		</tr>
	<%
		end if
		rs.close
		set rs = nothing
	%>
	</tbody>
</table>
</body>
</html>